Skip to main content

MareNostrum 5

Package Managers

Spack

Spack is an intuitive package manager that streamlines the process of installing scientific software. It enables users to select the optimal compiler, version, and dependencies for their needs.

We recommend reviewing the comprehensive how-to documentation for BSC Users and Other Users

  • Load the spack module:
module load spack

Spack Basics

  • List all installed packages:
spack find
  • List all avaliable compilers:
spack compilers
  • Load/Unload a package:
spack (un)load <package_name>
  • List loaded packages:
spack find --loaded

BSC Users

BSC Users have access to the glogin4 node, which has an internet connection. This allows them to have their own Spack installation and install packages in their home/projects/scratch directories, as well as use the system Spack as a secondary library.

To do this, BSC Users wishing to install software with their own Spack will need to download and install it at their Home.

Install Spack in your Home

Download the new version of Spack and Follow the official Spack guide

Now you should have working Spack installation in your home, using the default system python, making sure to module unload any python modules you might have

Chaining Spack Installation

Create the upstreams.yaml in accordance with the example below for the GPP partition in your Spack:

$HOME/spack/etc/spack/defaults/upstreams.yaml

upstreams:
system_spack:
install_tree: /apps/GPP/SPACK/0.21.2/opt/spack

Same for the ACC partition:

upstreams:
system_spack:
install_tree: /apps/ACC/SPACK/0.21.2/opt/spack

If you use spack find you will be able to view all packages of the Spack system using your home Spack

Installing with Spack

  • List all avaliable packages:
spack list
  • Check all the information about a package:
spack info <package_name>
  • See what packages are going to be used for an installation:
spack spec <package_name>
  • Install/Uninstall a package:
spack (un)install <package_name>
info
  • When undertaking a specification/installation, it is possible to utilise the constraints offered by Spack to ensure that an installation is carried out in accordance with your needs.

spack spec/install <package_name> %<compiler>

spack spec/install <package_name> @<version>

spack spec/install <package_name> ^<package_name>

Other Users

Other Users are unable to access the glogin4 node and lack of internet connection. As a result, they are unable to install new packages in Spack.

Before requesting the installation of a new package, please ensure that it is available and specify the version, compiler and constraints. If it is not provided, the default version will be installed.

  • List all avaliable packages:
spack list
  • Check all the information about a package:
spack info <package_name>
info
  • Specify the constraints offered by Spack to ensure that an installation is carried out in accordance with your needs.

spack spec/install <package_name> %<compiler>

spack spec/install <package_name> @<version>

spack spec/install <package_name> ^<package_name>